package com.pt.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum TorrentStatus {
    PENDING(0, "待审核"),
    NORMAL(1, "正常"),
    DISABLED(2, "禁用");

    private final int code;
    private final String description;

    public static TorrentStatus fromCode(int code) {
        for (TorrentStatus status : TorrentStatus.values()) {
            if (status.getCode() == code) {
                return status;
            }
        }
        throw new IllegalArgumentException("Invalid TorrentStatus code: " + code);
    }
} 